{include file="header.html"}
<body class="body-main">

<ul id="admin_sub_title">
	<li class="unsub"><a href="{url('admin/cache/index')}">缓存设置</a></li>
	<li class="unsub"><a href="{url('admin/cache/clear')}">清除缓存</a></li>
	<li class="sub"><a href="javascript:void(0)">清除指定缓存</a></li>
</ul>

<div id="admin_right_b">
<form method="post">
<table border="0" align="center" cellpadding="8" cellspacing="0" class="tableConfig">
<tbody>
<tr>
  <td align="right" width="150">功能说明：</td>
  <td>
	<div style="color:red">可清除指定url或者指定域名下的缓存</div>
  </td>
</tr>
<tr class="tdbg item_title">
	<td align="right"><i class="typcn typcn-cog"></i> 基本设置</td>
	<td></td>
</tr>
<tr>
  <td align="right" class="config_td_first">URL地址：</td>
  <td><input name="url" type="text" id="url" style="text-align:left" class="input" value="" size="50"> 填写URL地址，http://或https://开头</td>
</tr>
<tr id="classlist" style="display:none">
  <td align="right" class="config_td_first">所属模型：</td>
  <td><select name="dirname" id="dirname">{foreach $class_list as $vo}<option value="{$vo.dirname}">{$vo.name}</option>{/foreach}</select> <span><font color="red">清除模板绑定缓存，必须选择对应的模型</font></span></td>
</tr>
<tr>
	<td align="right">清除类型：</td> 
	<td align="left"><select name="type" id="type" onchange="changetype(this.value)">
		<option value="tdk">tdk缓存</option>
		<option value="menu">导航缓存</option>
		<option value="link">外链缓存</option>
		<option value="theme">模板绑定缓存</option>
		<option value="html">页面缓存(hash方式)</option>
		<option value="htmlfile">页面缓存(url方式)</option>
		<option value="urlrules">url规则缓存</option>
		</select>
	</td>
</tr>
<tr class="tdbg">
	<td align="right">查询大小：</td>
	<td align="left"><span id="c_checksize"></span>&nbsp;<a onclick="aaction('checksize');" style="cursor:pointer">点击获取</a></td>
</tr>
<tr>
  <td align="right"></td>
  <td><button type="button" class="button" onclick="aaction('del');">开始清理</button> <span id="c_del">&nbsp;</span></td>
</tr>
</tbody>
</table>
</form>
  
<script type="text/javascript">
function changetype(type){
	if(type=='theme'){
		$('#classlist').show();
	}else{
		$('#classlist').hide();
	}
}
function aaction(ac){
	if($('#url').val()==''){
		showAlert('error','URL地址不能为空');
		return false;
	}
	$('#c_del').html('');
	$('#c_'+ac).html("<img src='static/images/load_blue.gif'>");
	$.ajax({
	   type: "POST",
	   url: "?admin-cache-clear_del-zd-1",
	   dataType: "json",
	   data: "action="+ac+"&file="+$('#url').val()+'&type='+$('#type').val()+'&dirname='+$('#dirname').val(),
	   success: function(a){
		   if(a.status==1){
				$('#c_'+ac).html("<font color='green'>"+a.size+"</font>");
		   }else{
				$('#c_'+ac).html("<font color='red'>"+a.info+"</font>");
		   }
	   }
	});
}
</script>
<div class="runtime"></div>  
</div>
{include file="footer.html"}
</body>
</html>